﻿using System.Windows;
using Telerik.Windows.Controls;
using Telerik.Windows.Controls.GridView;
using System.Windows.Media;

namespace Styles
{
    public class GridViewRowStyleSelector : StyleSelector
    {
        public override Style SelectStyle(object item, DependencyObject container)
        {
            return base.SelectStyle(item, container);
        }

        private Style getDefaultStyle() 
        {
            Style st = new Style();
            st.TargetType = typeof(GridViewRow);
            return st;
        }

        protected Style GetBackGroundStyle(Brush brush) 
        {
            Style st = getDefaultStyle();
            Setter backGroundSetter = new Setter();
            backGroundSetter.Property = GridViewRow.BackgroundProperty;
            backGroundSetter.Value = brush;
            st.Setters.Add(backGroundSetter);
            return st;
        }
    }
}
